<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>URLCodec (Apache Commons Codec 1.10 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="URLCodec (Apache Commons Codec 1.10 API)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/URLCodec.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/commons/codec/net/QuotedPrintableCodec.html" title="class in org.apache.commons.codec.net"><span class="strong">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/commons/codec/net/URLCodec.html" target="_top">Frames</a></li>
<li><a href="URLCodec.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.commons.codec.net</div>
<h2 title="Class URLCodec" class="title">Class URLCodec</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.commons.codec.net.URLCodec</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../../../../../org/apache/commons/codec/BinaryDecoder.html" title="interface in org.apache.commons.codec">BinaryDecoder</a>, <a href="../../../../../org/apache/commons/codec/BinaryEncoder.html" title="interface in org.apache.commons.codec">BinaryEncoder</a>, <a href="../../../../../org/apache/commons/codec/Decoder.html" title="interface in org.apache.commons.codec">Decoder</a>, <a href="../../../../../org/apache/commons/codec/Encoder.html" title="interface in org.apache.commons.codec">Encoder</a>, <a href="../../../../../org/apache/commons/codec/StringDecoder.html" title="interface in org.apache.commons.codec">StringDecoder</a>, <a href="../../../../../org/apache/commons/codec/StringEncoder.html" title="interface in org.apache.commons.codec">StringEncoder</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="strong">URLCodec</span>
extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>
implements <a href="../../../../../org/apache/commons/codec/BinaryEncoder.html" title="interface in org.apache.commons.codec">BinaryEncoder</a>, <a href="../../../../../org/apache/commons/codec/BinaryDecoder.html" title="interface in org.apache.commons.codec">BinaryDecoder</a>, <a href="../../../../../org/apache/commons/codec/StringEncoder.html" title="interface in org.apache.commons.codec">StringEncoder</a>, <a href="../../../../../org/apache/commons/codec/StringDecoder.html" title="interface in org.apache.commons.codec">StringDecoder</a></pre>
<div class="block">Implements the 'www-form-urlencoded' encoding scheme, also misleadingly known as URL encoding.
 <p>
 This codec is meant to be a replacement for standard Java classes <a href="http://docs.oracle.com/javase/7/docs/api/java/net/URLEncoder.html?is-external=true" title="class or interface in java.net"><code>URLEncoder</code></a> and
 <a href="http://docs.oracle.com/javase/7/docs/api/java/net/URLDecoder.html?is-external=true" title="class or interface in java.net"><code>URLDecoder</code></a> on older Java platforms, as these classes in Java versions below
 1.4 rely on the platform's default charset encoding.
 <p>
 This class is immutable and thread-safe.</div>
<dl><dt><span class="strong">Since:</span></dt>
  <dd>1.2</dd>
<dt><span class="strong">Version:</span></dt>
  <dd>$Id: URLCodec.java 1563226 2014-01-31 19:38:06Z ggregory $</dd>
<dt><span class="strong">See Also:</span></dt><dd><a href="http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1">Chapter 17.13.4 Form content types</a>
           of the <a href="http://www.w3.org/TR/html4/">HTML 4.01 Specification</a></dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!--   -->
</a>
<h3>Field Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/net/URLCodec.html#charset">charset</a></strong></code>
<div class="block"><strong>Deprecated.</strong>&nbsp;
<div class="block"><i>TODO: This field will be changed to a private final Charset in 2.0.</i></div>
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected static byte</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/net/URLCodec.html#ESCAPE_CHAR">ESCAPE_CHAR</a></strong></code>
<div class="block">Release 1.5 made this field final.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected static <a href="http://docs.oracle.com/javase/7/docs/api/java/util/BitSet.html?is-external=true" title="class or interface in java.util">BitSet</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/net/URLCodec.html#WWW_FORM_URL">WWW_FORM_URL</a></strong></code>
<div class="block">BitSet of www-form-url safe characters.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/commons/codec/net/URLCodec.html#URLCodec()">URLCodec</a></strong>()</code>
<div class="block">Default constructor.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/commons/codec/net/URLCodec.html#URLCodec(java.lang.String)">URLCodec</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;charset)</code>
<div class="block">Constructor which allows for the selection of a default charset.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>byte[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/net/URLCodec.html#decode(byte[])">decode</a></strong>(byte[]&nbsp;bytes)</code>
<div class="block">Decodes an array of URL safe 7-bit characters into an array of original bytes.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/net/URLCodec.html#decode(java.lang.Object)">decode</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj)</code>
<div class="block">Decodes a URL safe object into its original form.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/net/URLCodec.html#decode(java.lang.String)">decode</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;str)</code>
<div class="block">Decodes a URL safe string into its original form using the default string charset.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/net/URLCodec.html#decode(java.lang.String,%20java.lang.String)">decode</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;str,
      <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;charset)</code>
<div class="block">Decodes a URL safe string into its original form using the specified encoding.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static byte[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/net/URLCodec.html#decodeUrl(byte[])">decodeUrl</a></strong>(byte[]&nbsp;bytes)</code>
<div class="block">Decodes an array of URL safe 7-bit characters into an array of original bytes.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>byte[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/net/URLCodec.html#encode(byte[])">encode</a></strong>(byte[]&nbsp;bytes)</code>
<div class="block">Encodes an array of bytes into an array of URL safe 7-bit characters.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/net/URLCodec.html#encode(java.lang.Object)">encode</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj)</code>
<div class="block">Encodes an object into its URL safe form.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/net/URLCodec.html#encode(java.lang.String)">encode</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;str)</code>
<div class="block">Encodes a string into its URL safe form using the default string charset.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/net/URLCodec.html#encode(java.lang.String,%20java.lang.String)">encode</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;str,
      <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;charset)</code>
<div class="block">Encodes a string into its URL safe form using the specified string charset.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static byte[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/net/URLCodec.html#encodeUrl(java.util.BitSet,%20byte[])">encodeUrl</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/BitSet.html?is-external=true" title="class or interface in java.util">BitSet</a>&nbsp;urlsafe,
         byte[]&nbsp;bytes)</code>
<div class="block">Encodes an array of bytes into an array of URL safe 7-bit characters.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/net/URLCodec.html#getDefaultCharset()">getDefaultCharset</a></strong>()</code>
<div class="block">The default charset used for string decoding and encoding.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/net/URLCodec.html#getEncoding()">getEncoding</a></strong>()</code>
<div class="block"><strong>Deprecated.</strong>&nbsp;
<div class="block"><i>Use <a href="../../../../../org/apache/commons/codec/net/URLCodec.html#getDefaultCharset()"><code>getDefaultCharset()</code></a>, will be removed in 2.0.</i></div>
</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long,%20int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!--   -->
</a>
<h3>Field Detail</h3>
<a name="charset">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>charset</h4>
<pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
protected&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> charset</pre>
<div class="block"><span class="strong">Deprecated.</span>&nbsp;<i>TODO: This field will be changed to a private final Charset in 2.0.</i></div>
<div class="block">The default charset used for string decoding and encoding.</div>
</li>
</ul>
<a name="ESCAPE_CHAR">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ESCAPE_CHAR</h4>
<pre>protected static final&nbsp;byte ESCAPE_CHAR</pre>
<div class="block">Release 1.5 made this field final.</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.commons.codec.net.URLCodec.ESCAPE_CHAR">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="WWW_FORM_URL">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>WWW_FORM_URL</h4>
<pre>protected static final&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/util/BitSet.html?is-external=true" title="class or interface in java.util">BitSet</a> WWW_FORM_URL</pre>
<div class="block">BitSet of www-form-url safe characters.</div>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="URLCodec()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>URLCodec</h4>
<pre>public&nbsp;URLCodec()</pre>
<div class="block">Default constructor.</div>
</li>
</ul>
<a name="URLCodec(java.lang.String)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>URLCodec</h4>
<pre>public&nbsp;URLCodec(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;charset)</pre>
<div class="block">Constructor which allows for the selection of a default charset.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>charset</code> - the default string charset to use.</dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="encodeUrl(java.util.BitSet, byte[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>encodeUrl</h4>
<pre>public static final&nbsp;byte[]&nbsp;encodeUrl(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/BitSet.html?is-external=true" title="class or interface in java.util">BitSet</a>&nbsp;urlsafe,
               byte[]&nbsp;bytes)</pre>
<div class="block">Encodes an array of bytes into an array of URL safe 7-bit characters. Unsafe characters are escaped.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>urlsafe</code> - bitset of characters deemed URL safe</dd><dd><code>bytes</code> - array of bytes to convert to URL safe characters</dd>
<dt><span class="strong">Returns:</span></dt><dd>array of bytes containing URL safe characters</dd></dl>
</li>
</ul>
<a name="decodeUrl(byte[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decodeUrl</h4>
<pre>public static final&nbsp;byte[]&nbsp;decodeUrl(byte[]&nbsp;bytes)
                              throws <a href="../../../../../org/apache/commons/codec/DecoderException.html" title="class in org.apache.commons.codec">DecoderException</a></pre>
<div class="block">Decodes an array of URL safe 7-bit characters into an array of original bytes. Escaped characters are converted
 back to their original representation.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>bytes</code> - array of URL safe characters</dd>
<dt><span class="strong">Returns:</span></dt><dd>array of original bytes</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/DecoderException.html" title="class in org.apache.commons.codec">DecoderException</a></code> - Thrown if URL decoding is unsuccessful</dd></dl>
</li>
</ul>
<a name="encode(byte[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>encode</h4>
<pre>public&nbsp;byte[]&nbsp;encode(byte[]&nbsp;bytes)</pre>
<div class="block">Encodes an array of bytes into an array of URL safe 7-bit characters. Unsafe characters are escaped.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/BinaryEncoder.html#encode(byte[])">encode</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/commons/codec/BinaryEncoder.html" title="interface in org.apache.commons.codec">BinaryEncoder</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>bytes</code> - array of bytes to convert to URL safe characters</dd>
<dt><span class="strong">Returns:</span></dt><dd>array of bytes containing URL safe characters</dd></dl>
</li>
</ul>
<a name="decode(byte[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decode</h4>
<pre>public&nbsp;byte[]&nbsp;decode(byte[]&nbsp;bytes)
              throws <a href="../../../../../org/apache/commons/codec/DecoderException.html" title="class in org.apache.commons.codec">DecoderException</a></pre>
<div class="block">Decodes an array of URL safe 7-bit characters into an array of original bytes. Escaped characters are converted
 back to their original representation.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/BinaryDecoder.html#decode(byte[])">decode</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/commons/codec/BinaryDecoder.html" title="interface in org.apache.commons.codec">BinaryDecoder</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>bytes</code> - array of URL safe characters</dd>
<dt><span class="strong">Returns:</span></dt><dd>array of original bytes</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/DecoderException.html" title="class in org.apache.commons.codec">DecoderException</a></code> - Thrown if URL decoding is unsuccessful</dd></dl>
</li>
</ul>
<a name="encode(java.lang.String, java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>encode</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;encode(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;str,
            <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;charset)
              throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/UnsupportedEncodingException.html?is-external=true" title="class or interface in java.io">UnsupportedEncodingException</a></pre>
<div class="block">Encodes a string into its URL safe form using the specified string charset. Unsafe characters are escaped.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>str</code> - string to convert to a URL safe form</dd><dd><code>charset</code> - the charset for str</dd>
<dt><span class="strong">Returns:</span></dt><dd>URL safe string</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/UnsupportedEncodingException.html?is-external=true" title="class or interface in java.io">UnsupportedEncodingException</a></code> - Thrown if charset is not supported</dd></dl>
</li>
</ul>
<a name="encode(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>encode</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;encode(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;str)
              throws <a href="../../../../../org/apache/commons/codec/EncoderException.html" title="class in org.apache.commons.codec">EncoderException</a></pre>
<div class="block">Encodes a string into its URL safe form using the default string charset. Unsafe characters are escaped.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/StringEncoder.html#encode(java.lang.String)">encode</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/commons/codec/StringEncoder.html" title="interface in org.apache.commons.codec">StringEncoder</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>str</code> - string to convert to a URL safe form</dd>
<dt><span class="strong">Returns:</span></dt><dd>URL safe string</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/EncoderException.html" title="class in org.apache.commons.codec">EncoderException</a></code> - Thrown if URL encoding is unsuccessful</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/commons/codec/net/URLCodec.html#getDefaultCharset()"><code>getDefaultCharset()</code></a></dd></dl>
</li>
</ul>
<a name="decode(java.lang.String, java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decode</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;decode(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;str,
            <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;charset)
              throws <a href="../../../../../org/apache/commons/codec/DecoderException.html" title="class in org.apache.commons.codec">DecoderException</a>,
                     <a href="http://docs.oracle.com/javase/7/docs/api/java/io/UnsupportedEncodingException.html?is-external=true" title="class or interface in java.io">UnsupportedEncodingException</a></pre>
<div class="block">Decodes a URL safe string into its original form using the specified encoding. Escaped characters are converted
 back to their original representation.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>str</code> - URL safe string to convert into its original form</dd><dd><code>charset</code> - the original string charset</dd>
<dt><span class="strong">Returns:</span></dt><dd>original string</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/DecoderException.html" title="class in org.apache.commons.codec">DecoderException</a></code> - Thrown if URL decoding is unsuccessful</dd>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/UnsupportedEncodingException.html?is-external=true" title="class or interface in java.io">UnsupportedEncodingException</a></code> - Thrown if charset is not supported</dd></dl>
</li>
</ul>
<a name="decode(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decode</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;decode(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;str)
              throws <a href="../../../../../org/apache/commons/codec/DecoderException.html" title="class in org.apache.commons.codec">DecoderException</a></pre>
<div class="block">Decodes a URL safe string into its original form using the default string charset. Escaped characters are
 converted back to their original representation.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/StringDecoder.html#decode(java.lang.String)">decode</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/commons/codec/StringDecoder.html" title="interface in org.apache.commons.codec">StringDecoder</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>str</code> - URL safe string to convert into its original form</dd>
<dt><span class="strong">Returns:</span></dt><dd>original string</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/DecoderException.html" title="class in org.apache.commons.codec">DecoderException</a></code> - Thrown if URL decoding is unsuccessful</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/commons/codec/net/URLCodec.html#getDefaultCharset()"><code>getDefaultCharset()</code></a></dd></dl>
</li>
</ul>
<a name="encode(java.lang.Object)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>encode</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;encode(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj)
              throws <a href="../../../../../org/apache/commons/codec/EncoderException.html" title="class in org.apache.commons.codec">EncoderException</a></pre>
<div class="block">Encodes an object into its URL safe form. Unsafe characters are escaped.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/Encoder.html#encode(java.lang.Object)">encode</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/commons/codec/Encoder.html" title="interface in org.apache.commons.codec">Encoder</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>obj</code> - string to convert to a URL safe form</dd>
<dt><span class="strong">Returns:</span></dt><dd>URL safe object</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/EncoderException.html" title="class in org.apache.commons.codec">EncoderException</a></code> - Thrown if URL encoding is not applicable to objects of this type or if encoding is unsuccessful</dd></dl>
</li>
</ul>
<a name="decode(java.lang.Object)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decode</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;decode(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj)
              throws <a href="../../../../../org/apache/commons/codec/DecoderException.html" title="class in org.apache.commons.codec">DecoderException</a></pre>
<div class="block">Decodes a URL safe object into its original form. Escaped characters are converted back to their original
 representation.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/Decoder.html#decode(java.lang.Object)">decode</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/commons/codec/Decoder.html" title="interface in org.apache.commons.codec">Decoder</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>obj</code> - URL safe object to convert into its original form</dd>
<dt><span class="strong">Returns:</span></dt><dd>original object</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/DecoderException.html" title="class in org.apache.commons.codec">DecoderException</a></code> - Thrown if the argument is not a <code>String</code> or <code>byte[]</code>. Thrown if a failure
             condition is encountered during the decode process.</dd></dl>
</li>
</ul>
<a name="getDefaultCharset()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDefaultCharset</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getDefaultCharset()</pre>
<div class="block">The default charset used for string decoding and encoding.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the default string charset.</dd></dl>
</li>
</ul>
<a name="getEncoding()">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getEncoding</h4>
<pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
public&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getEncoding()</pre>
<div class="block"><span class="strong">Deprecated.</span>&nbsp;<i>Use <a href="../../../../../org/apache/commons/codec/net/URLCodec.html#getDefaultCharset()"><code>getDefaultCharset()</code></a>, will be removed in 2.0.</i></div>
<div class="block">The <code>String</code> encoding used for decoding and encoding.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Returns the encoding.</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/URLCodec.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/commons/codec/net/QuotedPrintableCodec.html" title="class in org.apache.commons.codec.net"><span class="strong">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/commons/codec/net/URLCodec.html" target="_top">Frames</a></li>
<li><a href="URLCodec.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2002&#x2013;2014 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>
